import { http } from "@/utils/http";

export interface SingerVO {
  id: number;
  uid: string;
  uname: string;
  email: string | null;
  phone: string | null;
  sex: string | null;
  birthday: string | null;
  avatarUrl: string | null;
  description: string | null;
  isSinger: number;
}

export const singerManageAPI = () => {
  const getSinger = (name:string): any => {
    return http.get(`user/singers/page?name=${name}`);
  };

  const addSinger = (data: SingerVO): any => {
    return http.post("singer/add", data);
  };

  const updateSinger = (data: SingerVO): any => {
    return http.post("user/updateUserInfo", data);
  };

  const deleteSinger = (data: SingerVO): any => {
    return http.delete("singer", { data });
  };

  const getNotSinger = (): any => {
    return http.get(`user/singers/getNotSinger`);
  };

  return {
    getSinger,
    addSinger,
    updateSinger,
    deleteSinger,
    getNotSinger
  };
};